#ifndef __HOST_H__
#define __HOST_H__
int gUSBConnected;

int g_port_2_USBConnected;
int g_port_1_USBChannged = 0;
int g_port_2_USBChannged = 0;




volatile	uint32_t   HOST_RhscIntr = 0;         /* Root Hub Status Change interrupt                       */
volatile	uint32_t   HOST_WdhIntr  = 0;         /* Semaphore to wait until the TD is submitted            */
volatile	uint8_t    HOST_TDControlStatus = 0;

//Enum
volatile HCED *p_Enum_EDCtrl;   
volatile uint32_t HOST_p_Enum_EDCtrl_WdhIntr = 0;
volatile HCTD *TDHead_Enum;                    /* Head transfer descriptor structure                     */
volatile HCTD *TDTail_Enum;                    /* Tail transfer descriptor structure                     */
volatile uint8_t *p_Enum_TDBuffer;  

//udisk
volatile HCED *EDCtrl;                    /* Control endpoint descriptor structure                  */
volatile HCED *EDBulkIn;                  /* BulkIn endpoint descriptor  structure                  */
volatile HCED *EDBulkOut;                 /* BulkOut endpoint descriptor structure                  */
volatile uint32_t HOST_EDCtrl_WdhIntr = 0;
volatile uint32_t HOST_EDBulkIn_WdhIntr = 0;
volatile uint32_t HOST_EDBulkOut_WdhIntr = 0;
volatile HCTD *TDHead;                    /* Head transfer descriptor structure                     */
volatile HCTD *TDTail;                    /* Tail transfer descriptor structure                     */
volatile uint8_t  *TDBuffer;                  /* Current Buffer Pointer of transfer descriptor          */

//Hid
volatile HCED *p_HidEDCtrl;                    /* hid Control endpoint descriptor structure                  */
volatile uint32_t HOST_p_HidEDCtrl_WdhIntr = 0;
//mouse
volatile HCED *p_EDBulkIn;                  /*hid BulkIn endpoint descriptor  structure                  */
volatile uint32_t HOST_p_EDBulkIn_WdhIntr = 0;
volatile HCTD *p_TDHead;          /* Head transfer descriptor structure                       */
volatile HCTD *p_TDTail;          /* Tail transfer descriptor structure     */

//keyboard
volatile HCED *p_K_EDBulkIn;                    /* hid Control endpoint descriptor structure                  */
volatile uint32_t HOST_p_K_EDBulkIn_WdhIntr = 0;
volatile HCTD *p_K_TDHead;          /* Head transfer descriptor structure                       */
volatile HCTD *p_K_TDTail;          /* Tail transfer descriptor structure     */

//usbcom
volatile	HCED        *EDCtrl_com;                    /* Control endpoint descriptor structure                  */
volatile	HCED        *EDBulkIn_com;                  /* BulkIn endpoint descriptor  structure                  */
volatile	HCED        *EDBulkOut_com;                 /* BulkOut endpoint descriptor structure                  */
volatile	uint32_t   HOST_EDCtrl_com_WdhIntr  = 0; 
volatile	uint32_t   HOST_EDBulkIn_com_WdhIntr  = 0; 
volatile	uint32_t   HOST_EDBulkOut_com_WdhIntr  = 0; 
volatile	HCTD        *TDHead_com;                    /* Head transfer descriptor structure                     */
volatile	HCTD        *TDTail_com;                    /* Tail transfer descriptor structure                     */
volatile	HCTD        *TDHead_comIn;                    /* Head transfer descriptor structure                     */
volatile	HCTD        *TDTail_comIn;                    /* Tail transfer descriptor structure                     */
volatile	uint8_t  *TDBuffer_com;                  /* Current Buffer Pointer of transfer descriptor          */
volatile	uint8_t  *TDBuffer_comIn;                  /* Current Buffer Pointer of transfer descriptor          */


volatile	HCCA        *Hcca;                      /* Host Controller Communications Area structure          */ 
uint16_t  *TDBufNonVol;               /* Identical to TDBuffer just to reduce compiler warnings */


volatile	uint8_t  *FATBuffer;                 /* Buffer used by FAT file system                         */
volatile	uint8_t  *UserBuffer;                /* Buffer used by application                             */

volatile	uint32_t  UnrecoverableIntCount = 0;
#endif
